﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
using System.Data.SqlClient;
using System.Drawing;
using System.Net.Mail;

using System.Web.Services;
using AjaxControlToolkit;
using System.IO.MemoryMappedFiles;


public partial class admin_partner_dahboard_partner : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["email"] == null)
        {
            Response.Redirect("sessiont.aspx");
        }
        Label4.Text = Session["email"].ToString();
        Label1.Text = Session["email"].ToString();
        string date = null;
        int s = 0;
        Label2.Text = s.ToString();

        DateTime dt = DateTime.UtcNow.Date;
        DateTime dateTime = DateTime.UtcNow.Date;
        // Response.Write(dateTime.ToString("yyyy/M/dd"));
        string s_date = dateTime.ToString("yyyy/M/dd");
        SqlConnection conn = null;
        conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        conn.Open();
        SqlCommand scmd = new SqlCommand("SELECT * FROM task where added_by='" + Session["email"] + "'  and fast_reminder='" + s_date + "'", conn);

        SqlDataReader dr = scmd.ExecuteReader();
        if (dr.Read())
        {
            date = dr[8].ToString();
            s_date.Equals(dr[8].ToString());
            {
                Label6.Visible = true;
                Panel1.Visible = true;
                Label6.Text = "You Have a New Reminder of today";
                ////Response.Write(date);
                // Response.Write(@"<script language='javascript'>alert('Its time')</script>");
            }
        }
        else
        {

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        SqlConnection conn = null;
        conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
        conn.Open();

        SqlCommand cm = new SqlCommand("update request5 set status1=1 where added='" + Session["email"] + "'", conn);
        cm.ExecuteNonQuery();

        conn.Close();

    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("../partner.aspx");
    }
     protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        if (e.CommandName == "active")
        {

            //Label1.Text = "hello";
            int index = Convert.ToSByte(e.CommandArgument);

            GridViewRow row = GridView1.Rows[index];
            SqlDataAdapter adp = new SqlDataAdapter();
            SqlCommand cmd = new SqlCommand();
            DataSet ds = new DataSet();


            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connstr"].ConnectionString);

            //  SqlConnection con = new SqlConnection("Data Source=MRINAL-PC;Initial Catalog=onlinejobportal;User Id=sa;Password=mrinal");
            con.Open();

            SqlCommand objectvalue = new SqlCommand("", con);
            cmd.Connection = con;


            SqlCommand cmd1 = new SqlCommand("update request5 set status1=1 where r_id='" + row.Cells[0].Text + "'", con);
            cmd1.ExecuteNonQuery();
            Session["r_id"] = row.Cells[0].Text;
            //  Response.Write(@"<script language='javascript'>alert('Client is inactive now')</script>");
            //
            Response.Redirect("notification.aspx");
            // con.Close();
            //Response.Write(row.Cells[0].Text);
            con.Close();
        }
    }
    }
